package cn.online.dao;

import java.util.List;

import cn.online.model.Teacher;

public class TeacherDao extends GenericDao<Teacher,Integer> {
	
	public Teacher get(String username,String password){
		List teacherL=getHibernateTemplate().find("from Teacher as t where t.tname=? and t.tpassword=?",new Object[]{username,password});
		if(teacherL.size()!=0)
			return (Teacher)teacherL.get(0);
		return null;
	}
	
	public Teacher get(String username){
		List teacherL=getHibernateTemplate().find("from Teacher as t where t.tname=?",new Object[]{username});
		if(teacherL.size()!=0)
			return (Teacher)teacherL.get(0);
		return null;
	}
}
